package com.umeox.watch.moto.dataservice.db.dao;


import android.database.Cursor;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.umeox.watch.moto.dataservice.db.model.AlarmClock;

import java.util.List;

@Dao
public interface AlarmDao {

    @Query("SELECT * FROM alarm_clock")
    List<AlarmClock> queryAll();

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(AlarmClock alarmClock);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(List<AlarmClock> alarmClocks);

    @Delete
    int delete(AlarmClock alarmClock);

    @Delete
    void delete(List<AlarmClock> alarmClocks);

    @Query("DELETE FROM alarm_clock WHERE alarmId >0 AND alarmId<2147483647")
    int deleteAllRemote();

    @Query("DELETE FROM alarm_clock")
    int deleteAll();

    @Query("SELECT * FROM alarm_clock")
    Cursor query();
}
